Sessions

interface Sessions

The Sessions interface provides methods for authenticating, updating, or revoking sessions, and properties to retrieve the existing session token (opaque or JWT).

Types

Link copied to clipboard
data class AuthParams(val sessionDurationMinutes: UInt? = null)

Data class used for wrapping parameters used with Sessions authentication

Link copied to clipboard
data class RevokeParams(val forceClear: Boolean = false)

Data class used for wrapping parameters used with Sessions revocation

Functions

Link copied to clipboard
abstract suspend fun authenticate(authParams: Sessions.AuthParams): AuthResponse
abstract fun authenticate(authParams: Sessions.AuthParams, callback: (AuthResponse) -> Unit)

Authenticates a Session and updates its lifetime by the specified session_duration_minutes. If the session_duration_minutes is not specified, a Session will not be extended

Link copied to clipboard
abstract suspend fun revoke(params: Sessions.RevokeParams = RevokeParams()): BaseResponse
abstract fun revoke(params: Sessions.RevokeParams = RevokeParams(), callback: (BaseResponse) -> Unit)

Revoke a Session and immediately invalidate all its tokens.

Link copied to clipboard
abstract fun updateSession(sessionToken: String?, sessionJwt: String?)

Updates the current session with a sessionToken and/or sessionJwt

Properties

Link copied to clipboard
abstract val sessionJwt: String?
Link copied to clipboard
abstract val sessionToken: String?